<template>
  <view v-if="largeSkuCover" class="sku-cover" @click="closeLargeCover">
    <image class="sku-cover" mode="widthFix" :src="largeSkuCover"></image>
  </view>
</template>

<script>
import store from "store"
import { mapGetters, mapActions } from 'vuex'

export default {
  name: "ProductLargeSkuCoverCom",
  store,
  computed: {
    ...mapGetters([
      'largeSkuCover'
    ])
  },
  methods: {
    ...mapActions(['updateLargeSkuCover']),
    async closeLargeCover() {
      await this.updateLargeSkuCover(null)
    }
  }
}
</script>

<style lang="scss" scoped>
.sku-cover {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  background: black;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  .sku-cover {
    display: block;
    width: 100%;
    margin-top: 25%;
  }
}
</style>
